package com.qst.crop.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qst.crop.dao.DiscussDao;
import com.qst.crop.entity.Discuss;
import com.qst.crop.entity.Order;
import com.qst.crop.service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussServiceImpl implements DiscussService {

    @Autowired
    private DiscussDao discussDao;

    /**
     * 根据konwledgeId查询评论
     * @param kId
     * @return
     */
    @Override
    public List<Discuss> selectByKonwledge(Integer kId){
        return discussDao.selectByKonwledge(kId);
    }

    //TODO
    /**
     * 查询所有评论 ———————————————————————— 测试用
     * @return
     */
    @Override
    public List<Discuss> selectAllDiscuss(){
        return discussDao.selectAllDiscuss();
    }


    /**
     * 添加评论
     * @param discuss
     * @return
     */
    @Override
    public int adByKnowledge(Discuss discuss){
        return discussDao.adByKnowledge(discuss);
    }
}
